1. Field of the Invention
The present invention relates to a communication system having a master device and slave devices.
2. Description of the Related Art
As an example where serial communication is carried out between one master device and plural slave devices, there is an example where a data line and a clock line are shared by all the slave devices (for example, see Japanese Laid-Open Patent Application No. 5-292148). Even when a communication bit length is different for each slave device, it is possible to carry out communication with the plural slave devices where a data line and a clock line are shared for the plural slave devices having different communication bit widths, by using a bit length setting register.
Further, there is a configuration where by having a clock generation circuit, it is possible to carry out communication at a communication rate suitable for each device to carry out communication with (for example, see Japanese Laid-Open Patent Application No. 2006-304011).
In a case where serial communication is carried out, a master device which carries out system control is to start an operation of the serial communication. Generally speaking, a SPI (Serial Peripheral Interface) or an IIC (Inter-Integrated Circuit) may be used for serial communication. For example, in a case where an apparatus such as a printer controls plural slave devices, a master device carries out communication with the slave devices periodically, for example, every several milliseconds through tens of milliseconds, to obtain information indicating states of the slaves.
In a system where communication is carried out from only a master device, generally speaking the master device is to carry out communication periodically with slave devices every predetermined time period to obtain information from the slave devices.
In a case where the number of slave devices connected with a master device is large, it may be a considerable load of the master device to read the states of the slave devices. For example, there may be a system where a sensor is connected to a slave device and information is sent to a master device from the slave device only when a state of the sensor changes. However, when the slave device is connected with the master device in a serial connection manner, the master device can know a change in the state of the slave device by only reading information from the slave device by the master device by itself. Therefore, when intervals at which the master device reads the information from the slave device are too long, the slave device cannot immediately send a change in the state of the sensor to the master device. When the intervals are too short, the communication amount is increased and the load of the CPU of the master device is increased accordingly.